package com.ehotting.mqbd.zw.netty.config;


import com.ehotting.eaf.netty.client.ConnectorIdleStateTrigger;
import com.ehotting.eaf.netty.client.TcpClientHelper;
import com.ehotting.eaf.netty.domain.DataAble;
import com.ehotting.eaf.netty.loggers.NettyMsgReceiveLogger;
import com.ehotting.eaf.netty.loggers.NettyMsgSendLogger;
import com.ehotting.eaf.netty.sync.SyncFutureMapHelper;
import com.ehotting.mqbd.core.manager.AgentLinkManager;
import com.ehotting.mqbd.zw.api.domain.netty.ZwCommPacket;
import com.ehotting.mqbd.zw.netty.netty.*;
import io.netty.bootstrap.Bootstrap;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

/**
 * 连接中望Tcp服务的配置类
 */
@Configuration
public class ZwServerNettyConfig {

    /**
     * 配置因为处理类扫描
     * @return
     */
    @Bean("zwNettyActionFactory")
    @DependsOn(value = "springUtils")
    public ZwNettyActionFactory zwNettyActionFactory(){
        ZwNettyActionFactory actionFactory = new ZwNettyActionFactory();
        actionFactory.setScanPackage("com.ehotting.mqbd.zw.netty.zwAction");
        return actionFactory;
    }

    @Bean
    public Bootstrap serverBootstrap(){
        return new Bootstrap();
    }


    @Bean(name="zwNettySyncFutureMapHelper",initMethod = "start",destroyMethod = "stop")
    public SyncFutureMapHelper<ZwCommPacket> zwNettySyncFutureMapHelper(){
        return new SyncFutureMapHelper<>();
    }






}